package com.cy.personer.biz.impl;

import com.cy.personer.bean.Log;
import com.cy.personer.biz.LogBiz;
import com.cy.personer.mapper.LogMapper;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class LogBizImpl implements LogBiz {
    @Resource
    private LogMapper logMapper;
    @Override
    public int addLog(Log log) {
        return logMapper.addLog(log);
    }

    @Override
    public PageInfo<Log> getLogs(Log log, int pageNum, int pageSize) {
        Page<Log> page=PageHelper.startPage(pageNum,pageSize);
        logMapper.getLogs(log);
        PageInfo<Log> pageInfo=new PageInfo<>(page);
        return pageInfo;
    }
}
